<UserControl xmlns="https://github.com/avaloniaui"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:viewModels="clr-namespace:AvaTest.ViewModels"
             xmlns:oxy="http://oxyplot.org/avalonia"
             xmlns:liveChartsCore="clr-namespace:LiveChartsCore;assembly=LiveChartsCore"
             xmlns:avalonia="clr-namespace:LiveChartsCore.SkiaSharpView.Avalonia;assembly=LiveChartsCore.SkiaSharpView.Avalonia"
             mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
             x:Class="AvaTest.Views.TemperatureView">
    <Design.DataContext>
        <viewModels:GpioViewModel/>
    </Design.DataContext>

    <Grid ColumnDefinitions="3*,*">
        <avalonia:CartesianChart Series = "{Binding Series}" />
        <Grid Grid.Column="1" RowDefinitions="Auto, *, *, Auto">
            <Grid.Styles>
                <Style Selector="TextBlock">
                    <!-- <Setter Property="FontSize" Value="32"/> -->
                    <Setter Property="Margin" Value="5"/>
                    <Setter Property="VerticalAlignment" Value="Center"></Setter>
                </Style>
            </Grid.Styles>
            <TextBlock Text="Сейчас:"/>
            
            <Grid Grid.Row="1" RowDefinitions="5*,*,*" ColumnDefinitions="Auto, *, Auto, Auto">
                <Grid.Styles>
                    <Style Selector="TextBlock.leftAligned" >
                        <Setter Property="TextAlignment" Value="Left"></Setter>
                        <Setter Property="FontSize" Value="40"/>
                    </Style>
                    <Style Selector="TextBlock.Bolded">
                        <Setter Property="FontWeight" Value="Bold"/>
                    </Style>
                    
                </Grid.Styles>
                <TextBlock Text="Парилка"/>
                <Viewbox Grid.Row="0" Grid.Column="1" HorizontalAlignment="Left">
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="{Binding TemperatureInCelsius}"
								   Classes="leftAligned Bolded"
								   />
                        <TextBlock Text="℃" Classes="leftAligned"/>
                    </StackPanel>
                </Viewbox>
                
                <Grid Grid.Column="3" RowDefinitions="*,*,*" Opacity="0.1" VerticalAlignment="Center" Margin="5">
                    <Grid.Styles>
                        <Style Selector="Svg">
                            <Setter Property="Width" Value="24"/>
                            <Setter Property="Height" Value="24"/>
                        </Style>
                    </Grid.Styles>
                    <Svg Grid.Row="2" Path="/Assets/up_arrow_icon.svg" IsVisible="{Binding IsTemperatureRising}"/>
                    <Svg Grid.Row="2" Path="/Assets/updown_arrow_icon.svg" IsVisible="{Binding IsTemperatureKeeping}"/>
                    <Svg Grid.Row="2" Path="/Assets/down_arrow_icon.svg" IsVisible="{Binding IsTemperatureCooling}"/>
                </Grid>

                <TextBlock Grid.Row="1" Grid.Column="0" Text="Отдых:"/>
                <Viewbox Grid.Row="1" Grid.Column="1" HorizontalAlignment="Left" Grid.ColumnSpan="2">
                    <StackPanel  Orientation="Horizontal">
                        <TextBlock Text="{Binding InternalTemperature}"  Classes="leftAligned Bolded"/>
                        <TextBlock Text="℃" Classes="leftAligned"/>
                    </StackPanel>
                </Viewbox>
                <TextBlock Grid.Row="2" Grid.Column="0" Text="Влажность:"/>
                <Viewbox Grid.Row="2" Grid.Column="1" HorizontalAlignment="Left" Grid.ColumnSpan="2">
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="{Binding Humidity}" Classes="leftAligned Bolded" />
                        <TextBlock Text="мм рт ст" Classes="leftAligned"/>
                    </StackPanel>
                </Viewbox>
            </Grid>
        </Grid>
    </Grid>
</UserControl>
